package com.ibm.cps.servlet.starter.spark;

import com.ibm.cps.servlet.starter.CommandlineStarter;
import com.ibm.util.LocalConfig;

/**
 * Created by telekinesis on 6/23/15.
 */
public class SparkClusterStarter extends CommandlineStarter {
	
	public SparkClusterStarter(String path) {
		super(path);
	}

	@Override
	public String createShellCommand(String tenantId) {
		String checkpointPath = tenantId + "_checkpoint";
		String sparkJarPath = LocalConfig.SPARK_JAR_PATH;
		String dependencyPath = LocalConfig.SPARK_DEPENDENCY_PATH;
		return "sh " + shellPath + " " + tenantId + " " + LocalConfig.TASK_PER_SPARK_TOPOLOGY + " " + checkpointPath + " " + sparkJarPath + " " + dependencyPath;
	}

}
